<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./lib/layui/css/layui.css">
</head>
<body>
  <div class="layui-container">
    <div class="layui-row">
      <div class="layui-col-md3 layui-col-sm6">1</div>
      <div class="layui-col-md3 layui-col-sm6">1</div>
      <div class="layui-col-md3 layui-col-sm6">1</div>
      <div class="layui-col-md3 layui-col-sm6">1</div>
    </div>
  </div>
  <button class="layui-btn layui-btn-warm layui-btn-xs">按钮</button>
  <iframe src="http://www.baidu.com" frameborder="0"></iframe>
  <div class="rate"></div>
  <script src="./lib/layui/layui.js"></script>
  <script>
    // layui的内置js模块 模块引入
    layui.use(['jquery', 'rate'], function(){
      var $ = layui.jquery;
      var rate = layui.rate;
      var rateIns = rate.render({
        elem: '.rate',  //绑定元素
        length: 10,
        value: 8,
        choose: function(value){
         if(value>=8){
           alert('感谢您的好评,欢迎下次光临')
         }else{
           alert("别让我下次看到你，小心点")
         }
        }
      });
    })
  </script>
</body>
</html>